package com.tengju.bff.interfaces.covercharge.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * @author liang_shi
 * @date 2020/7/16 10:21
 * @description 操作记录状态
 */
@Getter
@AllArgsConstructor
public enum OperateBizTypeEnum {

    /**
     * 会员模块-收益分佣结算
     * <p>
     * MPS
     */
    PROFIT_SETTLE("MEMBER_PROFIT_SETTLE", "会员模块-收益分佣结算"),

    /**
     * 会员模块-收益分佣结算-存管账户节点
     */
    PROFIT_SETTLE_NODE_1("MPS_DEPO_ACCOUNT", "收益分佣结算-存管账户节点"),

    /**
     * 会员模块-收益分佣结算-服务费账户节点
     */
    PROFIT_SETTLE_NODE_2("MPS_SERVICE_ACCOUNT", "收益分佣结算-服务费账户节点"),


    ;

    private String type;

    private String msg;

    /**
     * 根据类型获取指定枚举
     *
     * @param type 类型
     * @return 结果
     */
    public static OperateBizTypeEnum getInstance(String type) {
        if (StringUtils.isBlank(type)) {
            return null;
        }
        for (OperateBizTypeEnum typeEnum : OperateBizTypeEnum.values()) {
            if (typeEnum.getType().equals(type)) {
                return typeEnum;
            }
        }
        return null;
    }

}
